﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DXApplicationTangche.UC.项目成果管理.service;

namespace DXApplicationTangche.UC.款式管理
{
    public partial class Form导入确认扫员工码 : DevExpress.XtraEditors.XtraForm
    {
        public String mnemonic { get; set; }
        public Form导入确认扫员工码()
        {
            InitializeComponent();
            this.textBox扫描.Focus();
        }
        private void textBox扫描_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)
            {
                try
                {
                    if (String.IsNullOrEmpty(this.textBox扫描.Text))
                    {
                        MessageBox.Show("无扫描信息");
                        return;
                    }
                    //判断扫描的工牌是否正确
                    String mnemonic = 项目成果Service.get判断扫描员工码是否正确(this.textBox扫描.Text.Trim());
                    if (String.IsNullOrWhiteSpace(mnemonic))
                    {
                        this.textBox扫描.Clear();
                        MessageBox.Show("扫描员工码错误，请重新扫描");
                        return;
                    }
                    this.mnemonic = mnemonic;
                    this.Close();
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.Message);
                }

            }
        }
    }
}